package com.bx.implatform.dto;

import com.bx.implatform.entity.Group;
import com.bx.implatform.entity.User;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
@Schema(description = "群聊会议请求DTO")
public class GroupRoomDTO {

    @NotNull(message = "群id不可为空")
    @Schema(description = "群id")
    private Long groupId;

    @NotEmpty(message = "会议室id不可为空")
    @Schema(description = "会议室id")
    private String roomId;

    @NotEmpty(message = "会议室名称不可为空")
    @Schema(description = "会议室名称")
    private String roomName;

    @NotEmpty(message = "会议号不可为空")
    @Schema(description = "会议号")
    private String roomNum;

    @NotEmpty(message = "会议类型不能为空")
    @Schema(description = "会议类型：0视频会议 1语音会议")
    private String roomType;

    @NotEmpty(message = "参会人员id不能为空")
    @Schema(description = "参会人员id")
    private List<String> receivers;

    @Schema(description = "群聊信息")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Group group;

    @Schema(description = "用户信息")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private User user;

    /**
     * 会议状态：0生效 1失效
     */
    @Schema(description = "会议状态：0生效 1失效")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    private Integer roomStatus;

    /**
     * 创建时间
     */
    @Schema(description = "创建时间")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8",
            shape = JsonFormat.Shape.STRING  // 明确指定序列化为字符串
    )
    private Date createdTime;

    /**
     * 结束时间
     */
    @Schema(description = "结束时间")
    @JsonProperty(access = JsonProperty.Access.READ_ONLY)
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8",
            shape = JsonFormat.Shape.STRING  // 明确指定序列化为字符串
    )
    private Date closedTime;
}
